﻿using System.Collections.Generic;
using VMukti.Business.CommonDataContracts;

namespace VMukti.Business.WCFServices.SuperNodeServices.NetP2P
{
    public class NetP2PSuperNodeDelegates:INetP2PSuperNodeService
    {
        public delegate void DelsvcJoin(string uname);
        public delegate void DelsvcSetSpecialMsg(string from, string to, string msg, clsModuleInfo objModInfo,string IPAddress);
        //public delegate void DelsvcPageSetSpecialMsg(string from, string to, string msg, List<clsModuleInfo> lstModInfo, string IPAddress);
        public delegate void DelsvcPageSetSpecialMsg(string from, string to, string msg, clsPageInfo objPageInfo, string IPAddress);
        public delegate void DelsvcAddDraggedBuddy(string from, string to, string msg, clsModuleInfo objModInfo, string IPAddress);
        public delegate void DelsvcAddPageDraggedBuddy(string from, string to, string msg, List<clsModuleInfo> lstModInfo, string IPAddress);
        public delegate void DelsvcSetRemoveDraggedBuddy(string from, List<string> to, string msg, clsModuleInfo objModInfo, string IPAddress);
        public delegate void DelsvcUnJoin(string uname);

        public event DelsvcJoin EntsvcJoin;
        public event DelsvcSetSpecialMsg EntsvcSetSpecialMsg;
        public event DelsvcPageSetSpecialMsg EntsvcPageSetSpecialMsg;
        public event DelsvcAddDraggedBuddy EntsvcAddDraggedBuddy;
        public event DelsvcAddPageDraggedBuddy EntsvcAddPageDraggedBuddy;
        public event DelsvcSetRemoveDraggedBuddy EntsvcSetRemoveDraggedBuddy;
        public event DelsvcUnJoin EntsvcUnJoin;

        public void svcJoin(string uname)
        {
            if (EntsvcJoin != null)
            {
                EntsvcJoin(uname);
            }
        }

        public void svcSetSpecialMsg(string from, string to, string msg, clsModuleInfo objModInfo,string IPAddress)
        {
            if (EntsvcSetSpecialMsg != null)
            {
                EntsvcSetSpecialMsg(from,to, msg, objModInfo,IPAddress);
            }
        }

        public void svcSetSpecialMsg(string from, string to, string msg, clsPageInfo objPageInfo, string IPAddress)
        {
            if (EntsvcPageSetSpecialMsg != null)
            {
                EntsvcPageSetSpecialMsg(from, to, msg, objPageInfo, IPAddress);
            }
        }

        public void svcAddDraggedBuddy(string from, string to, string msg, clsModuleInfo objModInfo, string IPAddress)
        {
            if (EntsvcAddDraggedBuddy != null)
            {
                EntsvcAddDraggedBuddy(from, to, msg, objModInfo, IPAddress);
            }
        }

        public void svcAddDraggedBuddy(string from, string to, string msg, List<clsModuleInfo> lstModInfo, string IPAddress)
        {
            if (EntsvcAddPageDraggedBuddy!= null)
            {
                EntsvcAddPageDraggedBuddy(from, to, msg, lstModInfo, IPAddress);
            }
        }

        public void svcSetRemoveDraggedBuddy(string from, List<string> to, string msg, clsModuleInfo objModInfo, string IPAddress)
        {
            if (EntsvcSetRemoveDraggedBuddy != null)
            {
                EntsvcSetRemoveDraggedBuddy(from, to, msg, objModInfo, IPAddress);
            }
        }

        public void svcUnJoin(string uname)
        {
            if (EntsvcUnJoin != null)
            {
                EntsvcUnJoin(uname);
            }
        }
    }
}
